<div class="panel panel-primary">
    <div class="panel-heading text-center">
        <h1>{{ display_project.name }}完成情况统计</h1>
    </div>

</div>
<div class="row">
    {# 侧边栏 #}
    <ul class="nav nav-pills nav-stacked col-lg-2 sidebar">
        {% for project in projects %}
            <li data-id="{{ project.id }}"><a href="/{{ project.id }}" class="project-bar">{{ project.name }}</a></li>
        {% endfor %}
    </ul>
    <div class="content col-lg-7">
        {% if modules %}
            <form class="modules" method="post" id="post-form" action="/form/">
                {% for module in modules %}
                    <div class="panel panel-module">
                        <div class="panel-heading module">
                            <h4>{{ module.name }}</h4>
                            <h4>负责人：{{ module.person_in_charge }}</h4>
                        </div>
                        <ol class="function on list-group">
                            {% for function in functions %}
                                {% if module.id == function.module_id_id %}
                                    <li class="list-group-item">
                                        <p>{{ function.function_point }}</p>
                                        <label class="Form-label--tick" for="{{ function.id }}_true">
                                            <input class="Form-label-radio" type="radio"
                                                   name="f-{{ module.id }}-{{ function.id }}"
                                                   id="{{ function.id }}_true" value="on"  {% if function.completion %}
                                                   checked="checked" {% endif %}>
                                            <span class="Form-label-text">完成</span>

                                        </label>
                                        <label class="Form-label--tick" for="{{ function.id }}_false">
                                            <input class="Form-label-radio" type="radio"
                                                   name="f-{{ module.id }}-{{ function.id }}"
                                                   id="{{ function.id }}_false" value="off"
                                                    {% if not function.completion %} checked="checked" {% endif %}>
                                            <span class="Form-label-text">未完成</span>
                                        </label>
                                    </li>
                                {% endif %}
                            {% endfor %}
                        </ol>
                    </div>

                {% endfor %}
                <button type="submit" id="submit" class="btn btn-info btn-lg">提 交</button>
            </form>
        {% else %}
            <div class="none">
                <span>该项目暂无数据，请在后台添加哦~</span>
                <a href="/admin" class="admin" target="_blank">前往>></a>
            </div>
        {% endif %}
    </div>
    {# 统计结果 #}
    <div class="statistics col-lg-3">
        <table class="table table-bordered table-hover">
            <caption class="caption">{{ display_project.name }}完成统计结果</caption>
            <thead>
            <tr>
                <th>模块</th>
                <th>通过率(%)</th>
            </tr>
            </thead>
            <tbody>
            {% for m in modules %}
                <tr>
                    <td>{{ m.name }}</td>
                    <td>{{ m.completion_rate }}</td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
</div>
